package com.zs.common.exception;

/**
 * Copyright 2020 ZS Network Co., Ltd. All rights reserved.
 * 本文件仅限于正数网络技术有限公司内部传阅，禁止外泄以及用于其他的商业目的。
 * Created by yuancong on 2022/10/15.
 *
 * 业务异常类
 */
public class BusinessException extends RuntimeException {
    private int code;

    public BusinessException() {
        this.code = -1;
    }

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(String message, int errorCode) {
        super(message);
        this.code = errorCode;
    }

    public BusinessException(String message, Throwable cause, int errorCode) {
        super(message, cause);
        this.code = errorCode;
    }

    public int getCode() {
        return this.code;
    }
}
